#include<iostream>
using namespace std;
string addStrings(string num1, string num2) {
    int len1 = num1.size();
    int len2 = num2.size();
    string num3;
    int next = 0;
    int number = 0;
    while (len1 || len2)
    {
        if (len1 > 0 && len2 > 0)
        {
            number = ((num1[len1 - 1] - '0') + (num2[len2 - 1] - '0'));
            number += next;
            next = number / 10;
            number %= 10;
            num3 += (char)number + '0';
            --len1;
            --len2;
        }
        else if (len1 == 0)
        {
            number = (num2[len2 - 1] - '0');
            number += next;
            next = number / 10;
            number %= 10;
            num3 += (char)number + '0';
            --len2;
        }
        else
        {
            number = (num1[len1 - 1] - '0');
            number += next;
            next = number / 10;
            number %= 10;
            num3 += (char)number + '0';
            --len1;
        }
    }

    if (next == 1)
    {
        num3 += '1';
    }
    reverse(num3.begin(), num3.end());
    return num3;
}



    string multiply(string num1, string num2) {
        string num3;
        string num4;
        int size1 = num1.size();
        int size2 = num2.size();

        for (int i = 0; i < size1; ++i)
        {
            int next = 0;
            num4.clear();
            for (int m = 0; m < size2; ++m)
            {
                int now = (int)(num1[i] - '0') * (int)(num2[size2 - m - 1] - '0') + next;
                next = now / 10;
                now %= 10;
                num4 += (char)now + '0';
            }
            if (next > 0)
            {
                num4 += (char)next + '0';
            }
            reverse(num4.begin(), num4.end());
            num3 = addStrings(num3, num4);
            if (i + 1 < size1)
            {
                num3 += '0';
            }

        }
        if (num3[0] == '0')
        {
            num3 = '0';
        }
        return num3;
    }

int main()
{
	return 0;
}